'use strict';

module.exports = appInfo => {
  const config = {};

  // should change to your own
  config.keys = appInfo.name + '_1504841364907_6992';
    config.view = {
        defaultViewEngine: 'ejs',
        mapping: {
            '.html': 'ejs',
        },
    };
    config.middleware=['checkTokenApp','checkTokenAdmin','wechatInfo','wechatOauth','wechatJssdk','getAccessToken'];
    config.checkTokenApp={match:"/api/app",};
    config.checkTokenAdmin={match:"/api/admin",};
    config.wechatInfo={match:"/app",};
    config.wechatOauth={match:"/app"};
    config.wechatJssdk={match:"/app"};
    config.getAccessToken={match:"/api/app"};
    config.sequelize = {
        dialect: 'mysql', // support: mysql, mariadb, postgres, mssql
        database: 'nowechat',
        host: 'localhost',
        port: '3306',
        username: 'root',
        password: 'windowwei',

    };
    config.oss = {
        client: {
            accessKeyId: 'LTAIqFzfJWgBI0YT',
            accessKeySecret: 'wDcvI2NodLP6yl6F3NLz6v4G6lBlHQ',
            bucket: 'nowechat',
            endpoint: 'oss-cn-shenzhen.aliyuncs.com',
            timeout: '60s',
        },
    };
    config.security = {
        csrf: {
            // 判断是否需要 ignore 的方法，请求上下文 context 作为第一个参数
            enable: false,
        },
        domainWhiteList:['.qq.com','.aliyuncs.com','http://192.168.0.101:8080','http://localhost:8080',".callmesoul.cn","39.108.143.18","http://39.108.143.18"],  // security whitelist, starts with '.'
    };
    config.cors ={allowMethods:'GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS'};
    config.redis = {
        client: {
            host: '127.0.0.1',
            port: '6379',
            password: '',
            db: '0',
        },
    };
    config.weappSDK = {
        appId: 'wxf3f60cff276efc1b',
        appSecret: '1c72955d0c9e6fa511ec28ae8f0cce9c',
    };

    /* config.static = {
         prefix: '/',
         dir:'app/public',
    }; */


  // add your config here

  return config;
};
